// 模拟API接口定义
export default {
  // 用户相关接口
  user: {
    // 登录
    login: (data) => Promise.resolve({ code: 200, data: { token: 'fake_token' }, message: '登录成功' }),
    // 获取用户详情
    getUserInfo: () => Promise.resolve({ 
      code: 200, 
      data: { 
        id: 1,
        nickname: '张三',
        avatar: '/static/avatar/default.png'
      }, 
      message: '获取成功' 
    })
  },
  
  // 电站相关接口
  station: {
    // 获取附近电站列表
    getNearbyStations: () => Promise.resolve({
      code: 200,
      data: [
        {
          id: 1,
          name: '星星充电站(朝阳店)',
          distance: '1.2km',
          address: '北京市朝阳区建国路88号',
          gunCount: 10,
          availableGunCount: 6,
          price: '1.5元/度',
          score: 4.8,
          lat: 39.9042,
          lng: 116.4074
        },
        {
          id: 2,
          name: '特来电充电站(国贸店)',
          distance: '2.5km',
          address: '北京市朝阳区国贸CBD核心区',
          gunCount: 15,
          availableGunCount: 12,
          price: '1.8元/度',
          score: 4.6,
          lat: 39.9099,
          lng: 116.4235
        }
      ],
      message: '获取成功'
    }),
    
    // 获取电站详情
    getStationDetail: (id) => Promise.resolve({
      code: 200,
      data: {
        id: id,
        name: '星星充电站(朝阳店)',
        distance: '1.2km',
        address: '北京市朝阳区建国路88号',
        gunCount: 10,
        availableGunCount: 6,
        price: '1.5元/度',
        score: 4.8,
        images: ['/static/station/1.jpg', '/static/station/2.jpg'],
        phone: '010-12345678',
        openTime: '00:00-24:00',
        lat: 39.9042,
        lng: 116.4074,
        dcGunCount: 6,
        acGunCount: 4,
        dcAvailableGunCount: 4,
        acAvailableGunCount: 2
      },
      message: '获取成功'
    })
  },
  
  // 订单相关接口
  order: {
    // 获取订单列表
    getOrderList: () => Promise.resolve({
      code: 200,
      data: [
        {
          id: 1,
          orderNo: '202109010001',
          stationName: '星星充电站(朝阳店)',
          gunCode: 'A01',
          startTime: '2021-09-01 10:00:00',
          endTime: '2021-09-01 12:00:00',
          power: '45.5kWh',
          amount: '68.25',
          status: 1 // 1:已完成 2:充电中 3:已取消
        }
      ],
      message: '获取成功'
    }),
    
    // 获取订单详情
    getOrderDetail: (id) => Promise.resolve({
      code: 200,
      data: {
        id: id,
        orderNo: '202109010001',
        stationName: '星星充电站(朝阳店)',
        gunCode: 'A01',
        startTime: '2021-09-01 10:00:00',
        endTime: '2021-09-01 12:00:00',
        power: '45.5kWh',
        amount: '68.25',
        serviceFee: '5.00',
        status: 1,
        createTime: '2021-09-01 09:55:00'
      },
      message: '获取成功'
    })
  },
  
  // 钱包相关接口
  wallet: {
    // 获取钱包信息
    getWalletInfo: () => Promise.resolve({
      code: 200,
      data: {
        balance: 100.50,
        couponCount: 3
      },
      message: '获取成功'
    })
  },
  
  // 车辆相关接口
  car: {
    // 获取绑定车辆
    getBindCars: () => Promise.resolve({
      code: 200,
      data: [
        {
          id: 1,
          plateNumber: '京A88888',
          brand: '特斯拉 Model 3'
        }
      ],
      message: '获取成功'
    })
  },
  
  // 消息相关接口
  message: {
    // 获取消息列表
    getMessageList: () => Promise.resolve({
      code: 200,
      data: [
        {
          id: 1,
          title: '充电完成通知',
          content: '您的爱车已于12:00充电完成，请及时驶离车位',
          time: '2021-09-01 12:05:00',
          isRead: false
        }
      ],
      message: '获取成功'
    })
  }
}